#define _CRT_SECURE_NO_WARNINGS
class Solution {
public:
    int maxPower(string s) {
        if (s.size() == 1) return 1;
        auto it = s.begin() + 1;
        int count = 1;
        int ret = -1;

        while (it != s.end())
        {
            if (*it == *(it - 1)) count++;
            else
            {
                ret = max(ret, count);
                count = 1;
            }
            it++;
        }
        ret = max(ret, count);
        return ret;

    }
};